package com.scalar.chiptrack.utils;

import java.util.HashMap;
import java.util.Iterator;

/**
 * Created by IntelliJ IDEA.
 * User: muralikrishna.yengal
 * Date: Mar 6, 2006
 * Time: 12:13:36 PM
 * To change this template use File | Settings | File Templates.
 */
public class MapBackedHelperBean {

    private HashMap map = new HashMap();

    public void setValue(String key, Object value)
    {
        this.map.put(key, value);
    }

    public Object getValue(String key)
    {
        return this.map.get(key);
    }

    public String toString()
    {
        StringBuffer sb = new StringBuffer();
        if( this.map != null)
        {
            Iterator mapIterator = map.keySet().iterator();
            while( mapIterator.hasNext() )
            {
                String key = (String) mapIterator.next();
                String value = (String) this.map.get(key);
                sb.append(key);
                sb.append(":");
                sb.append(value);
                sb.append("\n");
            }
        }
        return sb.toString();
    }

}
